using System;
using System.Drawing;
using System.Windows.Forms;

namespace WindowsFormsDataBaice
{
    public static class IconManager
    {
        // Unicode图标字符
        public static class Icons
        {
            // 医疗相关图标
            public const string Hospital = "🏥";
            public const string Doctor = "👨‍⚕️";
            public const string Nurse = "👩‍⚕️";
            public const string Medicine = "💊";
            public const string Stethoscope = "🩺";
            public const string Heart = "❤️";
            public const string Cross = "➕";
            public const string Ambulance = "🚑";
            public const string Bed = "🛏️";
            public const string Syringe = "💉";
            public const string Pill = "💊";
            public const string Thermometer = "🌡️";
            public const string Bandage = "🩹";
            public const string Wheelchair = "♿";
            public const string Microscope = "🔬";
            public const string XRay = "📷";
            
            // 系统功能图标
            public const string Settings = "⚙️";
            public const string Database = "🗄️";
            public const string Backup = "💾";
            public const string Restore = "🔄";
            public const string User = "👤";
            public const string Users = "👥";
            public const string Lock = "🔒";
            public const string Unlock = "🔓";
            public const string Key = "🔑";
            public const string Search = "🔍";
            public const string Preview = "👁️";
            public const string Add = "➕";
            public const string Plus = "➕";
            public const string Edit = "✏️";
            public const string Delete = "🗑️";
            public const string Clear = "🗑️";
            public const string Save = "💾";
            public const string Print = "🖨️";
            public const string Export = "📤";
            public const string Import = "📥";
            public const string Download = "⬇️";
            public const string Upload = "⬆️";
            public const string Refresh = "🔄";
            public const string Home = "🏠";
            public const string Calendar = "📅";
            public const string Clock = "🕐";
            public const string Chart = "📊";
            public const string Money = "💰";
            public const string Calculator = "🧮";
            public const string File = "📄";
            public const string Folder = "📁";
            public const string Check = "✅";
            public const string Warning = "⚠️";
            public const string Error = "❌";
            public const string Info = "ℹ️";
            public const string Question = "❓";
            public const string Star = "⭐";
            public const string ThumbsUp = "👍";
            public const string ThumbsDown = "👎";
            public const string Login = "🔐";
            
            // 导航图标
            public const string ArrowRight = "➡️";
            public const string ArrowLeft = "⬅️";
            public const string ArrowUp = "⬆️";
            public const string ArrowDown = "⬇️";
            public const string Menu = "☰";
            public const string Close = "✖️";
            public const string Minimize = "➖";
            public const string Maximize = "⬜";
        }

        // 创建带图标的按钮
        public static Button CreateIconButton(string text, string icon, int width = 150, int height = 120, ButtonStyle style = ButtonStyle.Primary)
        {
            Button button = new Button
            {
                Text = $"{icon}\n{text}",
                Size = new Size(width, height),
                TextAlign = ContentAlignment.MiddleCenter,
                UseVisualStyleBackColor = false
            };

            UIStyleManager.ApplyButtonStyle(button, style);
            return button;
        }

        // 创建小图标按钮
        public static Button CreateSmallIconButton(string text, string icon, int width = 100, int height = 35, ButtonStyle style = ButtonStyle.Primary)
        {
            Button button = new Button
            {
                Text = $"{icon} {text}",
                Size = new Size(width, height),
                TextAlign = ContentAlignment.MiddleCenter,
                UseVisualStyleBackColor = false
            };

            UIStyleManager.ApplyButtonStyle(button, style);
            return button;
        }

        // 创建图标标签
        public static Label CreateIconLabel(string text, string icon, LabelStyle style = LabelStyle.Body)
        {
            Label label = new Label
            {
                Text = $"{icon} {text}",
                AutoSize = true
            };

            UIStyleManager.ApplyLabelStyle(label, style);
            return label;
        }

        // 获取模块对应的图标
        public static string GetModuleIcon(string moduleName)
        {
            switch (moduleName)
            {
                case "系统管理":
                    return Icons.Settings;
                case "门诊医生":
                    return Icons.Doctor;
                case "门诊管理":
                    return Icons.Hospital;
                case "门诊收费":
                    return Icons.Money;
                case "住院管理":
                    return Icons.Bed;
                case "药房管理":
                    return Icons.Medicine;
                case "药库管理":
                    return Icons.Database;
                case "财务管理":
                    return Icons.Calculator;
                case "挂号单设置":
                    return Icons.File;
                case "门诊单设置":
                    return Icons.File;
                case "住院单设置":
                    return Icons.File;
                case "数据库备份":
                    return Icons.Backup;
                case "科室管理":
                    return Icons.Users;
                case "权限管理":
                    return Icons.Lock;
                case "员工添加":
                    return Icons.User;
                case "数据恢复":
                    return Icons.Restore;
                default:
                    return Icons.Info;
            }
        }

        // 获取功能对应的图标
        public static string GetFunctionIcon(string functionName)
        {
            switch (functionName.ToLower())
            {
                case "添加":
                case "新增":
                    return Icons.Add;
                case "编辑":
                case "修改":
                    return Icons.Edit;
                case "删除":
                    return Icons.Delete;
                case "保存":
                    return Icons.Save;
                case "打印":
                    return Icons.Print;
                case "预览":
                    return Icons.Search;
                case "清空":
                case "清除":
                    return Icons.Refresh;
                case "关闭":
                    return Icons.Close;
                case "确定":
                case "确认":
                    return Icons.Check;
                case "取消":
                    return Icons.Close;
                case "搜索":
                    return Icons.Search;
                case "导出":
                    return Icons.Export;
                case "导入":
                    return Icons.Import;
                case "下载":
                    return Icons.Download;
                case "上传":
                    return Icons.Upload;
                default:
                    return Icons.Info;
            }
        }

        // 创建状态图标
        public static Label CreateStatusIcon(string status, bool isSuccess = true)
        {
            string icon = isSuccess ? Icons.Check : Icons.Error;
            string color = isSuccess ? "#28a745" : "#dc3545";
            
            Label label = new Label
            {
                Text = icon,
                Font = new Font("Segoe UI Emoji", 16),
                AutoSize = true
            };

            return label;
        }

        // 创建加载动画图标
        public static Label CreateLoadingIcon()
        {
            Label label = new Label
            {
                Text = "⏳",
                Font = new Font("Segoe UI Emoji", 16),
                AutoSize = true
            };

            return label;
        }
    }
} 